import unittest
from tools import *


class TestTools(unittest.TestCase):
    unit_test_configurer_name = "unit_test_configurer"

    def setUp(self):
        print("****************************************\n\nTools test starting...\n\n")

    def tearDown(self):
        print("\n\nTools test finished.\n\n****************************************")

    def test_normal(self):
        create_configurer(self.unit_test_configurer_name)
        assert(os.path.exists(configurer_dir.format(self.unit_test_configurer_name)))
        assert(os.path.exists(configurer_path.format(
            self.unit_test_configurer_name, self.unit_test_configurer_name)))
        assert(os.path.exists(configurer_test_path.format(
            self.unit_test_configurer_name, self.unit_test_configurer_name)))
        assert(os.path.exists("./logs/" + self.unit_test_configurer_name))

        archive_log(self.unit_test_configurer_name)
        assert(not os.path.exists("./logs/" + self.unit_test_configurer_name))

        delete_configurer(self.unit_test_configurer_name)
        assert(not os.path.exists(configurer_dir.format(self.unit_test_configurer_name)))
        assert(not os.path.exists(configurer_path.format(
            self.unit_test_configurer_name, self.unit_test_configurer_name)))
        assert(not os.path.exists(configurer_test_path.format(
            self.unit_test_configurer_name, self.unit_test_configurer_name)))
        assert(not os.path.exists("./logs/" + self.unit_test_configurer_name))
